#include <modules/threadControl.h>

threadControl::threadControl() {
    this->threadScore = 0;
    this->threads.resize( this->threadScore );
}

void threadControl::callThread( void func(), int index ) {
    if ( index > this->threadScore ) {
        this->threadScore = index;
        this->threads.resize( this->threadScore );
    }
    threads[index] = std::thread( func );
}

void threadControl::joinThread( int index ) {
    threads[index].join();
}
